<template>
  <div class="no_container">
    <h2>404</h2>
    <el-button @click="goHome">{{ second }}秒回到首页</el-button>
  </div>
</template>
<script setup lang="ts">
import { useRouter } from "vue-router";
import { ref } from "vue";
const router = useRouter();
function goHome() {
  router.push("/");
}
const secondNum = 5;
const second = ref(secondNum);
const time = setInterval(() => {
  if (second.value == 1) {
    clearInterval(time);
    goHome();
    return;
  }
  second.value--;
}, 1000);
</script>
